/**
 * Created by smile on 2017/4/26.
 */
public class TestArgs {
    public static void main(String[] args) {
        int [] args1;
        args1 = new int[4];
        for(int i=0;i<args.length;i++){
            args1[i] = 0;
        }

        for(int i=0;i<args.length;i++) {
            args1[i]=Integer.parseInt(args[i]);
        }
        System.out.println(clSum(0, args1));
    }

    public static int clSum(int i,int [] arr) {
        if(i < arr.length - 1)
            return arr[i]+clSum(i+1,arr);
        else return arr[i];
    }
}
    /*public class TestArgs {
        private int sum=0,num=1;
        public int calSum(int maxnum){
            if(num<=maxnum){
                sum+=num;
                num++;
                calSum(maxnum);
            }
            return sum;
        }
        public static void main(String[] args) {
            TestArgs test=new TestArgs();
            System.out.println("1+2+3+...10="+test.calSum(10));
        }
    }
*/